#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

export CI=1
npm run lint

# Not in master
if ! git diff HEAD master --quiet; then
  # if values files have BOTH been modified, then we know migrate is safe
  if test $(git diff origin/master --name-only | awk 'xor(/values-schema.yaml/,/values-changes.yaml/)' | wc -l) = 2; then
    npm run migrate-values -- -ni
  fi
fi
